<!-- Phan khai bao bien cuc bo-->
<!--bang chua tieu de cua form-->
<?php
$v_goto_url = "index.php";
$v_current_style_name = "round_row";
?>
<table width="100%" cellpadding="0" cellspacing="0" >
	<tr class="normal_title">
		<td><?php echo $v_title; ?>
			<a id="goto" href="" style=".color:white">#</a>
		</td>
	</tr>	
</table>
<!-- bang chua cac tieu thuc loc-->
<table cellpadding="0" cellspacing="0" width="100%" border="0">
	<col width="20%"><col width="30%"><col width="50%">
	<!--form chinh-->
		<form action="index.php" name="f_dsp_all_record_search" method="post">
		<input type="hidden" name="fuseaction" value="<?php echo $fuseaction; ?>">
		<input type="hidden" name="fuseaction_back" value="<?php echo $fuseaction_back; ?>">
		<input type="hidden" name="hdn_record_id" value=""> <!--Leav_15082008 -->
		<input type="hidden" name="hdn_record_id_list_22" value="">
		<input type='hidden' name='hdn_page' value='<?php echo $v_page;?>'>
		<input type='hidden' name='hdn_record_number_page' value='<?php echo $v_limit_row;?>'>
		<input type='hidden' name='hdn_tranfered' value='<?php echo $v_tranfered;?>'>	
		<!--Begin_Danh sach cac Link -->
		<tr><td height="5pt"></td></tr>
		<tr align="right">
		<td align="left" class="large_link" colspan="3"><?php 
			if ($v_count>0){ ?>
				<a href="#" name="btn_result_handle" onclick="btn_result_handle_onclick_tranh_chap(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list_22);btn_back_onclick('<?php echo $_GO_BACK?>');"><?php echo CONST_CONFLICTRECORD; ?></a>&nbsp;|
				<!--Leav_begin:15082008 -->
				<a href="#" name="btn_add" onclick="btn_result_handle_onclick_view_conflict(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list_22);"><?php echo CONST_VIEW_CONFLICTRECORD; ?></a>&nbsp;| 
				<!--Leav_end:15082008 -->
				<a href="#" name="btn_add" onClick="btn_back_onclick('<?php echo $_GO_BACK?>');"><?php echo _CONST_BACK_BUTTON; ?></a>
			<?php }?>
			</td>
		</tr>		
		<tr><td height="5pt"></td></tr>
		<!--End_Danh sach cac Link -->
<!--Bat dau cong xau html de in danh sach du lieu-->
<?php
if (is_null($v_xml_file_list) || $v_xml_file_list==""){
	$v_file_list = "danh_sach_ho_so_da_tiep_nhan.xml";
}else{
	$v_file_list = $v_xml_file_list;
}
//file dinh dang bang hien thi danh sach ho so da tiep nhan
$v_table_struct_xml_file = "../../xml/All/".$v_file_list;
if (file_exists($v_table_struct_xml_file)){
	$v_table_struct_xml_string = _read_file($v_table_struct_xml_file);
}else{
	$v_table_struct_xml_file = "../../xml/other/".$v_file_list;
	$v_table_struct_xml_string = _read_file($v_table_struct_xml_file);
}
//echo $v_table_struct_xml_file;
$table_struct_rax = new RAX(); 
$table_struct_rec = new RAX(); 
$table_struct_rax->open($v_table_struct_xml_string);
$table_struct_rax->record_delim = 'col';
$table_struct_rax->parse();
$table_struct_rec = $table_struct_rax->readRecord(); 
$v_html_string = '';
$v_html_string = $v_html_string  . '<form action="index.php" method="post" name="f_dsp_all_record">';
$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
$v_html_temp_width = '';
$v_html_temp_label = '';
$v_column = 0;
while ($table_struct_rec) { 
	$table_struct_row = $table_struct_rec->getRow();
	$v_label = $table_struct_row["label"];
	$v_width = $table_struct_row["width"];
	$v_html_temp_width = $v_html_temp_width  . '<col width="'.$v_width .'">';
	$v_html_temp_label = $v_html_temp_label . '<td align="center">'.$v_label.'</td>';
	$table_struct_rec = $table_struct_rax->readRecord();
	$v_column ++;
}
$v_html_string = $v_html_string  . $v_html_temp_width;
$v_html_string = $v_html_string  . '<tr class="header">';
$v_html_string = $v_html_string  . $v_html_temp_label;
$v_html_string = $v_html_string  . '</tr></table>';

$v_html_string = $v_html_string  . '<table class="list_table2" width="100%" cellpadding="0" cellspacing="0">';
$v_html_string = $v_html_string  . $v_html_temp_width;
	if ($v_count >0){
		for($row_index = 0;$row_index< $v_count ;$row_index++){
			$v_url = "";
			$v_received_record_xml_data = $arr_all_record[$row_index]['C_RECORD_XML_DATA'];
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";			
			}
			if($v_limited_date >= 5){
				if($v_record_date <= 3 && $v_record_date >0){
					$v_current_style_name = "red_row";
				}
			}
			
			$v_html_string = $v_html_string  .'<tr class="'.$v_current_style_name.'" >'; 
			$table_struct_rax = new RAX(); 
			$table_struct_rec = new RAX(); 
			$table_struct_rax->open($v_table_struct_xml_string);
			$table_struct_rax->record_delim = 'col';
			$table_struct_rax->parse();
			$table_struct_rec = $table_struct_rax->readRecord(); 
			while ($table_struct_rec) { 
				$table_struct_row = $table_struct_rec->getRow();
				$v_type = $table_struct_row["type"];
				$v_width = $table_struct_row["width"];
				$v_align = $table_struct_row["align"];
				$v_xml_data = $table_struct_row["xml_data"];
				$v_column_name = $table_struct_row["column_name"];
				$v_xml_tag_in_db = $table_struct_row["xml_tag_in_db"];
				$v_php_function = $table_struct_row["php_function"];
				$v_selectbox_option_sql = $table_struct_row["selectbox_option_sql"];
				if ($v_xml_data=="true"){
					$column_rax = new RAX(); 
					$column_rec = new RAX();
					$column_rax->open($v_received_record_xml_data);
					$column_rax->record_delim = 'data_list';
					$column_rax->parse();
					$column_rec = $column_rax->readRecord(); 
					$column_row = $column_rec->getRow();
					$v_value = _restore_XML_bad_char($column_row[$v_xml_tag_in_db]);
					$v_html_string = $v_html_string  . Element_Type($v_type); 
				}else{
					$v_value = $arr_all_record[$row_index][$v_column_name];
					//Lay ten cua can bo nhap ho so tranh chap _NgocNTM
					if($v_column_name =="FK_USER"){
						$v_value = _get_item_attr_by_id($_SESSION['arr_all_staff'],$v_value ,'name');//Ten can bo 
					}//End
					if ($v_type=="checkbox"){
						$v_value_id = $arr_all_record[$row_index][$v_column_name];
						$v_url = "row_onclick_conflict(" . "document.forms[0].hdn_record_id_list_22"  . "," . $v_value_id . ")";
					}
					$v_html_string = $v_html_string  . Element_Type($v_type); 
				}
				$table_struct_rec = $table_struct_rax->readRecord();
			}
			$v_html_string = $v_html_string  .'</tr>';
		}
	}
	if ($v_current_style_name == "odd_row"){
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	// begin--nieuvv--090708-----
	if ($v_current_style_name == "red_row"){
		$v_current_style_name ="odd_row" ;
		$v_next_style_name = "round_row";
	}else{
		$v_next_style_name = "odd_row";
	}
	//-------------------------------------------------
	
	// the--end--nieuvv--090708-----
$v_html_string = $v_html_string  . _add_empty_row($v_count,_CONST_NUMBER_OF_ROW_PER_LIST,$v_current_style_name,$v_next_style_name,$v_column);
//$v_html_string = $v_html_string  .'</table></div>';
$v_html_string = $v_html_string  .'</table>';
echo $v_html_string;
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td height="5pt"></td></tr>
	<tr ><?php
		if ($v_count>0){?>
			<td align="left" colspan = "2" class="small_label">
				<small class="small_starmark"><?php echo CONST_RECORD_COUNT_LIST_LABEL1 . $v_count . CONST_RECORD_COUNT_LIST_LABEL2;?></small>
			</td><?php
			if ($v_worktype!=""){?>
				<td class="normal_label" align="right">
					<input type="radio" name="rad_selectall" value="0" onClick="select_all_checkbox(document.forms[0],'chk_item_id');"><?php echo CONST_RECORD_SELECT_ALL_LABEL?>
					<input type="radio" name="rad_selectall" value="1" checked onClick="deselect_all(document.forms[0],'chk_item_id');"><?php echo CONST_RECORD_DESELECT_ALL_LABEL?>
				</td><?php
			}
		}else{?>
			<td align="left" colspan = "2" class="small_label">
				<small class="small_starmark"><?php echo CONST_RECORD_COUNT_LIST_LABEL;?></small>
			</td><?php
		}?>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<col width="5%"><col width="95%">
	<tr>
		<td align="right" class="normal_link">
		</td>
	</tr>
</table>
<!--Table chua cac button-->
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
	<tr><td height="5pt"></td></tr>
	<tr>
		<td align="center" colspan="10"><?php 
			if ($v_count>0){ //echo 'Test_V_count_conflict ='.$v_count;?>
					<input type="button" value="<?php echo CONST_CONFLICTRECORD; ?>" name="btn_add" style="width:15%" class="large_button" onclick="btn_result_handle_onclick_tranh_chap(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list_22);btn_back_onclick('<?php echo $_GO_BACK?>');">
					<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>');" onKeyDown="change_focus(document.forms(0),this)">
					<input type="button" value="<?php echo CONST_VIEW_CONFLICTRECORD; ?>" name="btn_add" style="width:15%" class="large_button" onClick="btn_result_handle_onclick_view_conflict(document.forms[0].chk_item_id,document.forms[0].hdn_record_id_list_22);">
				<?php } ?>
		</td>
	</tr>
</table>
</div id="hotkey">
</form> 
<script>
	document.all.goto.href="#<? echo $v_current_item_id;?>";
	document.all.goto.click();
</script>

	
